package cn.bon.schedule.controller;

import cn.bon.common.bean.JsonResult;
import cn.bon.common.tool.R;
import cn.bon.schedule.api.pojo.dto.AddSchedulePlanDTO;
import cn.bon.schedule.service.ScheduPlanService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Lc_cL
 * @Date 2024/1/15
 * @Description
 */
@Tag(name = "排班接口")
@RestController
public class ScheduleController {
    @Resource
    private ScheduPlanService scheduPlanService;

    /**
     * 新增排班
     * @param schedulePlanDTO
     * @return 添加成功/失败（string）
     */
    @Operation(summary = "新增排班")
    @PostMapping("/add")
    public JsonResult<String> addSchedule(@RequestBody AddSchedulePlanDTO schedulePlanDTO) {
        scheduPlanService.add(schedulePlanDTO);
        return R.success("添加成功");
    }


}
